import Vue from 'vue'
import VueRouter from 'vue-router'

// 引入views里面的.vue文件
import Home from '../views/home/Home.vue'
import Login from '../views/home/Login.vue'
import Register from '../views/home/Register.vue'
import Find from '../views/home/Find.vue'
import User from '../views/mine/User.vue'
import Friend from '../views/mine/Friend.vue'
import Group from '../views/mine/Group.vue'

Vue.use(VueRouter)

const routes = [
  
  {
    path: '/',//路径
    name: 'Home',//vue的名字
    component: Home,//组件的名字
    // children:[//子路由 该页面下的router-view
    //   {
    //     path: '/login',
    //     name: 'Login',
    //     component: Login,
    //   }
    // ]
  },
  {
    path: '/login',
    name: 'Login',
    component: Login,
  },
  {
    path: '/register',
    name: 'Register',
    component: Register,
  },
  {
    path: '/find',
    name: 'Find',
    component: Find,
  },
  {
    path: '/user',//路径
    name: 'User',//vue的名字
    component: User//组件的名字
  },
  {
    path: '/group',
    name: 'Group',
    component: Group,
  },
  {
    path: '/friend',
    name: 'Friends',
    component: Friend,
  },
  {
    path: '/friend/:chatId',
    name: 'Friend',
    component: Friend,
  },

]

const router = new VueRouter({
  routes
})

export default router
